import { request } from "../../utils/request";

//用户反馈
export function ApiFeedBack(content)
{
	return request({
		method: "GET",
		url:`chat/feedback?content=${content}`
	})
}

//语音播放
export function ApiListent(audio)
{
	return request({
		method: "GET",
		url:`chat/audio?audio=${audio}`
	})
}

//获取历史对话
export function ApigetAllHistory()
{
	return request({
		method: "GET",
		url:"chat/history"
	})
}

//根据id删除历史对话
export function ApidelHistory(time)
{
	return request({
		method: "GET",
		url:`chat/deleteByTime?time=${time}`
	})
}

//根据时间获取历史记录
export function ApigetHostoryByTime(time)
{
	return request({
		method: "GET",
		url:`chat/getHistoryByTime?time=${time}`
	})
}

//清除缓存
export function Apiclear(time)
{
	return request({
		method: "GET",
		url:"chat/clearCache"
	})
}

//语音的识别
export function ApiAddvoice(voice)
{
	return request({
		method: "GET",
		url:`chat/voice?voice=${voice}`
	})
}


//上传简历
export function ApiaddInterview(data={})
{
	return request({
		method: "POST",
		url:"interview/saveResume",
		data
	})
}

//判断是否上传了简历
export function ApiisUpload()
{
	return request({
		method: "GET",
		url:"interview/isUpload"
	})
}

//语音面试
export function ApiVoiceInterview(prompt,isOne)
{
	return request({
		method: "GET",
		url:`interview/getResume/voice?prompt=${prompt}&isOne=${true}`
	})
}

//语音对话
export function ApiVoicetoVoice(url)
{
	return request({
		method: "GET",
		url:`chat/voiceStream?voice=${url}`
	})
}

//调用阿里的通译tts实现语音对话
export function ApiTextToVoice(tts)
{
	return request({
		method: "GET",
		url:`chat/tts?text=${tts}`
	})
}

